package com.qbw.app.model;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;

/**
 * @author QBW
 * @date 2019/8/29
 */
public abstract class BaseModelList<T> extends BaseModel implements Serializable {
    @SerializedName(value = "list", alternate = {"vehicleList", "rows", "travelList"})
    private List<T> list;

    public BaseModelList() {
    }

    public BaseModelList(List<T> list) {
        this.list = list;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public int size() {
        return list == null ? 0 : list.size();
    }

    public boolean isEmpty() {
        return list == null || list.isEmpty();
    }
}
